<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<style>
	.form-item {
		margin: 20px 10px;
	}
	
	.form-item>label {
		letter-spacing: 3px;
		width: 110px;
		text-align: right;
		display: inline-block;
	}
	
	.form-item>label:AFTER {
		content: ":";
	}
	
	.form-item input[type=text] {
		width: 100px;
	}
	
	.form-item.required>label:BEFORE {
		content: "*";
		color: red;
	}
</style>
<form id="fupinaddForm"  method="post" enctype="multipart/form-data">
	<input type="hidden" name="userid" value="${user.userId}">
	<input type="hidden" name="userinfo" value="${FuPinEntity.userinfoId.userInfoId}">
	<h3 style="text-align: center;">编辑扶贫记录</h3>
	<div class="form-item required">
	<input type="hidden" name="fupinid" value="${FuPinEntity.fuPinId}">
		<label for="">申请人班级</label>
		<select data-options="editable:false" name="className" style="padding: 3px;height:24px;border-radius: 5px;border-color: dodgerblue;"onchange="move(this.value)" >
					<option value="">请选择</option>
					<c:forEach items="${classList }" var="list">
						<option value="${list.classId }" ${list.classId==classEntity.classId?'selected':'' }>${list.className }</option>
					</c:forEach>
		</select>
		
		<label for="">申请人姓名</label>
		<select id="student" data-options="editable:false" name="studentName" style="padding: 3px;height:24px;border-radius: 5px;border-color: dodgerblue;">
					<option value="">请选择</option>
					<c:forEach items="${studentList }" var="list">
						<option value="${list.stuId }" ${list.stuId==studentEntity.stuId?'selected':'' }>${list.studentName }</option>
					</c:forEach>
		</select>
		 
	
	</div>
	<div class="form-item required">
		<label style="margin-left: 100px;">扶贫资料为</label> 
		<input value="${FuPinEntity.fuPinData}" type="text" data-options="required:true" class="easyui-textbox" name="fuPinData">
		
		<%-- <label style="margin-left: 25px;">扶贫证明为</label>
		<input value="${FuPinEntity.fuPinProve}" type="text" data-options="required:true" class="easyui-textbox" name="fuPinProve"> --%>
	</div>
	<div class="form-item required">
		<label for="" style="margin-left: 90px;margin-top: 10px;">扶贫凭证</label>
		<input name="file" type="file" style="margin-top:-10px" data-options="required:true" />
	</div>
	<div class="form-item required">
		<label for="" style="margin-left: 90px;">扶贫原因</label>
		<input value="${FuPinEntity.fuPinReason}" style="width: 180px;height: 70px;"  type="text" data-options="required:true" class="easyui-textbox" name="fuPinReason">
	</div>
	<div class="form-item required">
		<label for="" style="margin-left: 90px;">申请时间</label>
		<input value="${FuPinEntity.fuPinApplyId.applyTime}" data-options="required:true" class="easyui-datetimebox" name="applyTime">
	</div>
	<div class="form-item required">
		<label for="" style="margin-left: 90px;">状态</label>
		<select style="height:24px;border-radius: 5px;border-color: dodgerblue;" name="state"> 
			<option value="已审核" ${FuPinEntity.fuPinState=='已审核' ? 'selected' : '' }>已审核</option>
			<option value="未通过" ${FuPinEntity.fuPinState=='未通过' ? 'selected' : ''}>未通过</option>
		</select>
	</div> 
</form>
<script>
	function move(obj) {
		var id=obj;
		var optionString = "";
		 $.get("caiwu/teamcontent/" + id, function(rs) {
				if (rs.success) {
					var data=rs.message;
					for (var i = 0; i < data.length; i++) {
							 optionString +="<option grade=\""+data[i].stuId+"\" value=\""+data[i].stuId+"\"";  
		                      optionString += ">"+data[i].studentName+"</option>";  //动态添加数据  
					}
					 $("select[id=student]").empty();
					 $("select[id=student]").append(optionString);
				}else{
					$.message.alert("提示错误！")
				}
			});
	}
</script>